<?php

namespace App\Http\Controllers\Wechat;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Repos\AreaRepo;

class AreaController extends Controller
{
    public function province()
    {
    	$rs['status'] = false;
    	$list = AreaRepo::getProvince();
    	if($list) {
    		$rs['status'] = true;
    		$rs['data']  = $list;
    		return $rs;
    	}

    	return reponse()->json($rs);
    }


    public function subarea(Request $request)
    {
    	$rs['status'] = false;
    	$num  = $request->num;
    	$list = AreaRepo::subArea($num);
    	if($list) {
    		$rs['status'] = true;
    		$rs['data']  = $list;
    		return $rs;
    	}
    	return reponse()->json($rs);
    }
}
